package com.hehe.##project_name#.Service;

import com.hehe.##project_name#.Mapper.*;
import com.hehe.##project_name#.Model.*;
// import com.hehe.##project_name#.Util.DateUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ##ClassServiceName# {
    @Autowired
    private ##DaoClassName# mapper;

    public int add(##ModelClassName# obj) throws Exception {
        // obj.setCreateTime(DateUtil.getTimeStampToSecond());
        // obj.setUpdateTime(DateUtil.getTimeStampToSecond());
        return mapper.add(obj);
    }

    public int delete(##ModelClassName# obj) throws Exception {
        // obj.setUpdateTime(DateUtil.getTimeStampToSecond());
        // obj.setDeleted(1);
        return mapper.delete(obj);
    }

    public int update(##ModelClassName# obj) throws Exception {
        // obj.setUpdateTime(DateUtil.getTimeStampToSecond());
        return mapper.update(obj);
    }

    public List<##ModelClassName#> getAll() {
        return mapper.getAll();
    }

    public ##ModelClassName# getSingle(Integer id) {
        return mapper.getSingle(id);
    }
}